/*
 * @Author: wxinlong 3075748076@qq.com
 * @Date: 2023-06-17 10:29:02
 * @LastEditors: wxinlong 3075748076@qq.com
 * @LastEditTime: 2023-07-08 10:05:34
 * @Description: 博客路由
 * Copyright (c) 2023 by wxinlong 3075748076@qq.com, All Rights Reserved.
 */
const express = require('express')
const router = express.Router()
const blogController = require('../controllers/blogController')

// 创建博客
router.post('/create', blogController.createBlog)
// 查询博客列表
router.get('/query', blogController.getBlogList)
// 根据 id 查询博客详情
router.get('/query/:id', blogController.getBlogById)
// 根据 id 修改博客
router.patch('/update/:id', blogController.updateBlog)
// 根据 id 删除博客
router.delete('/delete/:id', blogController.deleteBlog)
// 根据标签id查找关联了该标签的博客
router.get('/queryByTag/:tagId', blogController.queryByTag)

module.exports = router
